<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button {
            width: 100px;
            height: 50px;
            border-radius: 25px;
            background: wheat;
            color: cornflowerblue;
        }
    </style>
</head>

<body>
    <div id="app">
        <button :disabled="num>0" class="aa">倒计时{{num}}秒</button>
        <button @click="mybtn">倒计时开始</button>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",

            data() {
                return {
                    num: 10,
                    btn: true
                }
            },
            methods: {
                mybtn() {
                    var timer = setInterval(() => {
                        this.num--;
                        if (this.num == 0) {
                            clearInterval(timer);
                            this.num = "0"
                        }
                    }, 800)
                }
            }
        })
    </script>

</body>

</html>